from Page import Page
from selenium.webdriver.common.by import By
from time import sleep

class Page3(Page):
    sy_loc=(By.XPATH,'/html/body/div[3]/div[2]/ul/li[1]/a')
    def sy(self):
        self.click(self.sy_loc)
    sp_loc=(By.XPATH,'/html/body/div[8]/div[1]/div[2]/div[2]/ul/li[5]/div[1]/a/img')
    def sp(self):
        self.click(self.sp_loc)
    dy1_loc=(By.XPATH,'//*[@id="goodsForm"]/div/div[1]/span')
    def dy1(self):
        return self.text(self.dy1_loc)
    buy_loc=(By.ID,'buy-cart')
    def buy(self):
        self.click(self.buy_loc)
    di_loc=(By.ID,'address-49')
    def dz(self):
        self.click(self.di_loc)
    xib_loc=(By.CLASS_NAME,'ask-btn')
    def xib(self):
        self.click(self.xib_loc)


    def A3mall_sp(self):
        self.sy()
        self.sp()
        sleep(3)
        print(self.dy1())
        self.buy()
        self.dz()
        self.xib()
